home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
UTILITY
/
TASEXAM6.ARJ
/
MACD_SEL.TAS
< prev
next >
Wrap
Text File
|
1992-02-09
|
2KB
|
61 lines
{The MACD, both an oscillator and a trend following device, is relatively
useless when there is no trend and when there are only minor swings around
the trend. People who do backtesting with this indicator end up with medio-
cre results at best. Maybe this why it has become silent about this oldie.
But, if there has been a good trend and a good swing with it in either
direction, the MACD does a decent job to spot the turning-up's and -down's.
Therefore, I filter with a minimum percentage (!) away from the zero-line
and (!!!) with a completed buy or sell signal. This way you make sure to
go after a stock which has risen or fallen substantially and is about to
turn. TAS, unfortunately, does not graph MACD and MACDTRI in %-terms. The
3 moving averages in the stock chart tell you if the trend is well defined
or in a turning mode. If the trend is well defined i.e. the MA's move as
parallels without intersections, priority should be given to the trend.
This script deals only with the MACD indicating a top. For the other way,
please just replace the <'s, >'s, +'s and -'s and the like. The percentages
away from the zero-line, i.e. the %-difference of the MACD's components,
may be varied from stock to stock and adjusted to market conditions.
Good luck !}
#max_quotes 100
#output_file 'macd_sel.lst'
graph_switch = 1;
if first_ticker then
begin
writeln('TICKER SHORT MA LONG MA MACD_$ MACD_% TRIGGER');
end;
short_ma : array;
short_ma = mov(c,12,'e');
long_ma : array;
long_ma = mov(c,25,'e');
macd_abs : array;
macd_abs = macd();
macd_pct : array;
macd_pct = DIV(macd(),short_ma)* 100;
trigger : array;
trigger = MACDTRI();
if macd_pct > 2.0 and macd_pct < 3.0 and trigger > macd_abs then
BEGIN
gosub dograph;
writeln(ticker,short_ma,' ',long_ma,' ',macd_abs,'',macd_pct,
' ',trigger,' ',' ***SELL***');
if macd_pct > 3.0 and trigger > macd_abs then
BEGIN
gosub dograph;
writeln(ticker,short_ma,' ',long_ma,' ',macd_abs,'',macd_pct,
' ',trigger,' ',' ***STRONG SELL***');
END;
return;
:dograph
if graph_switch = 0 then return;
opengraph(2,-100,0);
sizegraph(1,1);
graph(1,mov(c,10,'s'),'10-days-SMA',mov(c,20,'s'),'20-days-SMA',
mov(c,40,'s'),'40-days-SMA')
graph(macd(),'MACD-$',trigger,'TRIGGER')
{drawline(11,0,2.0,0,2.0);}
{drawline(13,0,3.0,0,3.0);}
closegraph();
return;